package com.iplay.entity.hotel.discount;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

@Entity
@Table(name = "hotel_discount", indexes={@Index(unique=true, name="IDX_HOTEL_DATE",columnList="hotelId,date")})
//@SQLInsert(sql="INSERT INTO hotel_discount(hotel_id, date, discount) VALUES(?, ?, ?) ON DUPLICATE KEY UPDATE discount = VALUES(discount), id = LAST_INSERT_ID(id)" )
public class HotelDiscountDO {
	@Id
	@GeneratedValue
	private int id;
	private int hotelId;
	private long date;
	private String discount;
	
	public HotelDiscountDO() {
	}
	
	public HotelDiscountDO(int hotelId, long date, String discount) {
		super();
		this.hotelId = hotelId;
		this.date = date;
		this.discount = discount;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getHotelId() {
		return hotelId;
	}
	public void setHotelId(int hotelId) {
		this.hotelId = hotelId;
	}
	public String getDiscount() {
		return discount;
	}
	public void setDiscount(String discount) {
		this.discount = discount;
	}
	public long getDate() {
		return date;
	}
	public void setDate(long date) {
		this.date = date;
	}
}
